package site.qjdb.pojo.response;

/**
 * 	自定义返回服务器响应码
 * 
 * */
public class ResponseCode {
	private int code;
	private String message;
	//========================================= 通用 =========================================
	public static ResponseCode SUCCESS = new ResponseCode(200, "success");
	public static ResponseCode TOKEN_ERROR = new ResponseCode(300, "登陆状态已过期，请重新登录");
	public static ResponseCode PARAM_ERROR = new ResponseCode(301, "参数有误");
	public static ResponseCode Login_ERROR = new ResponseCode(302, "用户名或密码不正确");
	public static ResponseCode WARNING = new ResponseCode(303, "警告"); // 用户违规信息，操作对象状态有误
	public static ResponseCode ERROR = new ResponseCode(500, "错误"); // http，连接问题，系统故障

	//========================================= 老项目迁移 =========================================
	public static ResponseCode INCORECT_FORMAT = new ResponseCode(300, "格式不正确");


	public static ResponseCode ALREADY_REGIST = new ResponseCode(3000, "用户名已被注册");
	public static ResponseCode ILLEGAL_REGIST = new ResponseCode(3001, "非法注册");

	public static ResponseCode INCORRECT_LOGIN = new ResponseCode(3010, "用户名或密码不正确");
	public static ResponseCode ILLEGAL_LOGIN = new ResponseCode(3011, "非法登录");
	public static ResponseCode UNREGIST = new ResponseCode(3012, "Cookie请求登录但未注册");

	public static ResponseCode UNLOGIN = new ResponseCode(3020, "未登录（非法请求或session过期且Cookie也过期了)");

	public static ResponseCode GOODS_STATE_EXPIRED = new ResponseCode(3100, "商品session过期");
	public static ResponseCode INCOMPLETE_USER_INFO = new ResponseCode(3101, "用户个人信息不完整");

	public static ResponseCode GOODS_NOT_FOUND = new ResponseCode(3110, "未找到商品");

	public static ResponseCode NUMBER_OVERFLOW = new ResponseCode(3200, "购买数量大于剩余数量");
	public static ResponseCode ILLEGAL_NUMBER = new ResponseCode(3201, "商品数量异常");
	public static ResponseCode CART_EXIST = new ResponseCode(3202, "购物车内已有此商品且购买的商品数量大于商品总数量");

	public static ResponseCode ORDER_OWN_GOODS = new ResponseCode(3300, "不能预约自己发布的商品");

	public static ResponseCode COMMENT_NOT_FOUND  = new ResponseCode(3400, "留言未找到");














	public ResponseCode(int code, String message) {
		super();
		this.code = code;
		this.message = message;
	}

	public int getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

}
